#include "Comm.h"


void Comm::ClientSender(void* threadParams, string update) {
	//Sleep(1000);
	portIP* args = (portIP*)threadParams;
	char Buffer[10];
	cout << "Client Sender Started on: " + args->ipAddress + "Port: " + itoa(args->port,Buffer, 10) << endl;
	try {
		if(clientSenderSocket == NULL)
		{
			clientSenderSocket = &SocketClient(args->ipAddress, args->port);	
		}
		clientSenderSocket->SendLine(update);
	}
	catch ( string str ) { cerr << str << endl; }
	catch ( ... ) { cerr << "unhandled exception\n"; }
}
